From: Ewan Mellor Date: Mon, 26 Mar 2007 12:50:33 +0000 (+0100) Subject: Fix the xm mem-max command. Closes bug #933. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15275^2~4 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=10e9ec0d21905edd1bf134cabd4de60a516d77ce;p=xen.git Fix the xm mem-max command. Closes bug #933. Signed-off-by: Masaki Kanno --- diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index fd593b3653..7d0da6fc51 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -593,13 +593,15 @@ class XendDomainInfo: """Set the maximum memory limit of this domain @param limit: In MiB. """ - log.debug("Setting memory maximum of domain %s (%d) to %d MiB.", - self.info['name_label'], self.domid, limit) + log.debug("Setting memory maximum of domain %s (%s) to %d MiB.", + self.info['name_label'], str(self.domid), limit) if limit <= 0: raise XendError('Invalid memory size') - self.info['memory_static_max'] = limit + MiB = 1024 * 1024 + self.info['memory_static_max'] = limit * MiB + if self.domid >= 0: maxmem = int(limit) * 1024 try: @@ -607,7 +609,7 @@ class XendDomainInfo: except Exception, ex: raise XendError(str(ex)) else: - self.info['memory_dynamic_max'] = limit + self.info['memory_dynamic_max'] = limit * MiB xen.xend.XendDomain.instance().managed_config_save(self)